<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>



<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<head>
<meta charset="utf-8" />
<title>Color Admin | Page with Footer</title>
<meta
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
	name="viewport" />
<meta content="" name="description" />
<meta content="" name="author" />

<!-- ================== BEGIN BASE CSS STYLE ================== -->
<%@ include file="../../include/inc_head.jsp"%>
<!-- ================== END BASE CSS STYLE ================== -->

<!-- ================== BEGIN BASE JS ================== -->
<script src="/assets/plugins/pace/pace.min.js"></script>
<script type="text/javascript"
	src="/assets/My97DatePicker/WdatePicker.js"></script>
<!-- ================== END BASE JS ================== -->
</head>
<style>
.pagination {
    display: block;
}
</style>
<body>
	<!-- begin #page-loader -->
	<div id="page-loader" class="fade in">
		<span class="spinner"></span>
	</div>
	<!-- end #page-loader -->

	<!-- begin #page-container -->
	<div id="page-container"
		class="fade page-sidebar-fixed page-header-fixed">
		<!-- begin #header -->
		<%@ include file="../../include/inc_header.jsp"%>
		<!-- end #header -->

		<!-- begin #sidebar -->
		<%@ include file="../../include/inc_left.jsp"%>
		<!-- end #sidebar -->

		<!-- begin #content -->
		<div id="content" class="content">
			<!-- begin breadcrumb -->
			<ol class="breadcrumb pull-right">
				<li><a href="javascript:;">首页</a></li>
				<li class="active">订单管理</li>
			</ol>
			<!-- end breadcrumb -->
			<!-- begin page-header -->
			<h1 class="page-header">订单管理</h1>
			<!-- end page-header -->

	<div class="panel panel-inverse">
				<div class="panel-heading">

					<h4 class="panel-title" style="color: #f9f9fb;">查询条件</h4>
				</div>
				<div class="panel-body">
					<form class="form-inline" action="" method="POST">
								<div class="form-group m-r-10">
									<input type="text" class="form-control" name="orderSn" id="orderId" placeholder="订单号" />
								</div>
								<div class="form-group m-r-10">
									 <select class="form-control" name="tld" id="testSelect">
											<option value="-2">订单状态</option>
									 		<option value="-1">已取消</option>
									 		<option value="0">未确认</option>
											<option value="1">商家已确认</option>
											<option value="2">后台已确认</option>
											<option value="3">已发运</option>
											<option value="4">配送中</option>
											<option value="5">已收货</option>
											<option value="6">对账完成</option>
                                        </select>
								</div>
								<div class="form-group m-r-10">
									<input
						id="s_time" name="s_time" class="Wdate" type="text"
						style="width: 110px" placeholder="日期开始"
						onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',maxDate:'#F{$dp.$D(\'e_time\')||\'2020-10-01\'}'})" />
                                      - <input id="e_time" name="e_time" class="Wdate mr10"
						type="text" style="width: 110px" placeholder="日期结束"
						onFocus="WdatePicker({minDate:'#F{$dp.$D(\'s_time\')}',dateFmt:'yyyy-MM-dd HH:mm',maxDate:'2020-10-01'})" />
								</div>
								<button type="button" class="btn btn-sm btn-inverse m-r-5" onclick="doSearch();">查询</button>
								<button type="button" class="btn btn-sm btn-inverse m-r-5" onclick="/order/exportOrder">导出订单</button>
							</form>
					
				</div>
			</div>
			<div class="panel panel-inverse">
				<div class="panel-body">
					<table id="data-table" class="table table-striped table-bordered">
						<tr>
						</tr>
					</table>
				</div>
			</div>

		</div>
		<!-- end #content -->

		<%@ include file="../../include/inc_footer.jsp"%>
		<!-- begin scroll to top btn -->
		<a href="javascript:;"
			class="btn btn-icon btn-circle btn-success btn-scroll-to-top fade"
			data-click="scroll-top"><i class="fa fa-angle-up"></i></a>
		<!-- end scroll to top btn -->
	</div>
	<!-- end page container -->

	<!-- ================== BEGIN BASE JS ================== -->
	<%@ include file="../../include/inc_foot.jsp"%>

	<!-- ================== END BASE JS ================== -->

	<!-- ================== BEGIN PAGE LEVEL JS ================== -->
 	<script src="/assets/plugins/DataTables/media/js/jquery.dataTables.js"></script>
	<script src="/assets/plugins/DataTables/media/js/dataTables.bootstrap.min.js"></script>
	<script src="/assets/js/table-manage-default.demo.min.js"></script>
	<!-- <script src="/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
	<script src="/assets/plugins/bootstrap-datepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script> -->
	<script src="/assets/js/apps.min.js"></script>
	
	
	
	<link rel="stylesheet" type="text/css" href="/assets/jQueryEasyui/themes/gray/easyui.css">  
<link rel="stylesheet" type="text/css" href="/assets/jQueryEasyui/themes/icon.css">  
<link rel="stylesheet" type="text/css"
	href="/assets/jQueryEasyui/demo.css">
<!-- <link rel="stylesheet" type="text/css" href="/assets/jQueryEasyui/style.css">  

	<link rel="stylesheet" type="text/css"
	href="/assets/jQueryEasyui/list.css"> -->
<script type="text/javascript" src="/assets/jQueryEasyui/jquery.easyui.min.js"></script> 

	<script>
			$(function() {
			var wid=window.screen.width;
		$('#data-table')
				.datagrid(
						{
							title : '订单管理',
							loadMsg : '数据加载中,请稍后................',
							nowrap : true,
							striped : true,
							url : '/order/getList',
							pagination : true,
							rownumbers : false,
							singleSelect : false,
							border : true,
							pageSize : '10',
							columns : [ [
									{
										field : 'check',
										checkbox : true
									},
									{
										field : 'order_id',
										title : '订单ID',
										width :  wid*0.08  ,
										align : 'center'
									},
									{
										field : 'product',
										title : '商品',
										width :  wid*0.12  ,
										align : 'center',
										formatter : function(value, rec, index) {
											var product=rec.product;
											var str='';
											if(product!=undefined){
											for(var i=0;i<product.length;i++){
											str=str+'<div style="text-align:left;';
											if(i!=product.length-1){
											str=str+'border-bottom: 1px solid #d0dae4;';
											}
											str=str+'height:60px;"><img style="width:50px;height:50px;margin-top:5px;" src="'+product[i].image+'"/><span style="margin-left: 5px;">'+product[i].name+'x1</span></div>';
											}}
											return str;
										}
									},
									{
										field : 'counstmer',
										title : '收货人',
										width :   wid*0.1  ,
										align : 'center'
									},
									{
										field : 'c_t',
										title : '下单日期',
										width :   wid*0.1  ,
										align : 'center'
									},
									{
										field : 'status',
										title : '订单状态',
										width :     wid*0.05,
										align : 'center'
									},
									{
										field : 'allot_status',
										title : '分配状态',
										width :     wid*0.05,
										align : 'center'
									},
									{
										field : 'payment_type',
										title : '支付方式',
										width :    wid*0.05,
										align : 'center'
									},
									{
										field : 'order_from',
										title : '订单来源',
										width :    wid*0.05,
										align : 'center'
									},
									{
										field : 'order_mark',
										title : '订单备注',
										width :   wid*0.1,
										align : 'center'
									},
									{
										field : 'goods_amount',
										title : '订单金额',
										width :    wid*0.05,
										align : 'center'
									},
									{
										field : 'order_type',
										title : '订单类型',
										width :    wid*0.05,
										align : 'center'
									},
									{
										field : 'total_discount',
										title : '总优惠金额',
										width :    wid*0.05,
										align : 'center'
									},
									{
										field : 'paid_money',
										title : '已支付金额',
										width :    wid*0.05,
										align : 'center'
									},
									{
										field : 'freight_fee',
										title : '运费',
										width :   wid*0.05,
										align : 'center'
									},
									{
										field : 'pay_status',
										title : '支付状态',
										width :  wid*0.05,
										align : 'center'
									},
									{
										field : 'receive_price',
										title : '实收金额',
										width :    wid*0.05,
										align : 'center'
									},
									{
										field : 'tttt',
										title : '操作',
										align : 'center',
										width :   wid*0.12,
										formatter : function(value, rec, index) {
											var str ='<a href=/order/detail?order_id='+rec.order_id+'>查看详情</a>';
											str=str+'<a style="margin-left:20px;" href=/order/detail?order_id='+rec.order_id+'>取消订单</a>';
											return str;
										}
									} ] ]
						});
	 var p = $('#data-table').datagrid('getPager');
		$(p).pagination({
			pageSize : 10,
			pageList : [ 10, 20, 30 ]
		});  
		//获取活动分类
	});
	
	function fixWidth(percent)     
{     
    return (document.body.clientWidth - 5) * percent ;      
}  
		//查询
	function doSearch() {
		$('#data-table').datagrid('reload', {
			status : $('#testSelect option:selected').text(),
			order_id : $('#orderId').val(),
			s_time : $('#s_time').val(),
			e_time : $('#e_time').val(),
			order  :$('#data-table').datagrid("getSelections")
		});
	}
	App.init();
	</script>
</body>
</html>


